#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 2e5+10;

int n,m,p1,p2,k[N],stk[N],top,L[N],R[N],cnt,tot;
ll c1[N],c2[N],ans[N];
struct segm{int x,l,r,v;}seg[N<<2];
struct quer{int x,l,r,v,id;}q[N<<2];
bool operator < (segm a,segm b){return a.x < b.x;}
bool operator < (quer a,quer b){return a.x < b.x;}

void add(int x,int v){
	for(int i = x;i <= n;i += i & -i){
		c1[i] += v; c2[i] += 1ll * v * (x - 1);
	}
}

ll query(int x,ll v = 0){
	for(int i = x;i;i -= i & -i){
		v += c1[i] * x - c2[i];
	}return v;
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in;p1 = in,p2 = in; for(int i = 1;i <= n;i++) k[i] = in;
	stk[top = 0] = 0;
	for(int i = 1;i <= n;i++){
		while(top && k[stk[top]] < k[i]) top--;
		L[i] = stk[top]; stk[++top] = i;
	}
	stk[top = 0] = n + 1;
	for(int i = n;i >= 1;i--){
		while(top && k[stk[top]] < k[i]) top--;
		R[i] = stk[top]; stk[++top] = i;
	}
	for(int i = 1;i <= m;i++){
		int l = in,r = in;ans[i] += (r - l) * p1;
		q[++cnt] = (quer){l-1,l,r,-1,i}; q[++cnt] = (quer){r,l,r,1,i};
	}
	sort(q+1,q+cnt+1);
	for(int i = 1;i <= n;i++){
		if(R[i] < n + 1 && L[i]) seg[++tot] = (segm){R[i],L[i],L[i],p1};
		if(R[i] < n + 1&& L[i] + 1 < i) seg[++tot] = (segm){R[i],L[i]+1,i-1,p2};
		if(L[i] && R[i] - 1 > i) seg[++tot] = (segm){L[i],i+1,R[i]-1,p2};
	}
	sort(seg+1,seg+tot+1);
	for(int i = 1,j = 1;i <= cnt;i++){
		while(seg[j].x <= q[i].x && j <= tot){
			add(seg[j].l,seg[j].v);
			add(seg[j].r+1,-seg[j].v);
			j++;
		}
		ans[q[i].id] += q[i].v * (query(q[i].r) - query(q[i].l-1));
	}
	for(int i = 1;i <= m;i++) printf("%lld\n",ans[i]);
	return 0;
}
